package javas.net.rmi.server;

import java.net.UnknownHostException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

import javas.net.rmi.BaseService;
import javas.net.rmi.BaseServiceImpl;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;


public class ServerRmi {

	public static void main(String[] args) throws UnknownHostException {
		try {
			LocateRegistry.createRegistry(1099);
			BaseService service = new BaseServiceImpl();
			Context namingContext = new InitialContext();
			namingContext.rebind("rmi:BaseService", service);
			System.out.println("����ע��ɹ�!");
		} catch (NamingException e) {
			e.printStackTrace();
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		
	}

}
